<extend name="Public:base"/>

<block name="main">
<div id="yzh-content" class="col-xs-12">

    <div class="main-title">
        <h2>模型管理</h2>
    </div>

    <div class="table-actions">
        <a class="btn btn-sm btn-primary" href="{:U('Module/add')}">添加模型</a>
    </div>

    <form name="myform" action="{:U('Module/listorder')}" method="post">
        <table class="table table-bordered table-hover table-condensed">
            <thead>
                <tr>
                    <th width="40">ID</th>
                    <th>模型名称</th>
                    <th>数据表</th>
                    <th>描述</th>
                    <th>状态</th>
                    <th class="manage w-200">操作管理</th>
                </tr>
            </thead>
            <tbody>
                <volist name="list" id="vo" key="k">
                <tr>
                    <td align="center">{$vo['id']}</td>
                    <td>{$vo['title']}</td>
                    <td>{$vo['name']}</td>
                    <td>{$vo['description']}</td>
                    <td><if condition="$vo[status]==1">
                        <a class="btn btn-xs btn-success" href="{:U('module/status',array(id=>$vo['id'],status=>0))}">启用</a>
                        <else />
                        <a class="btn btn-xs btn-danger" href="{:U('module/status',array(id=>$vo['id'],status=>1))}">禁用</a>
                        </if></td>
                    <td class="manage table-cell-3">
                        <a class="btn btn-xs btn-primary" href="{:U('Field/index',array(moduleid=>$vo['id']))}">模型字段</a>
                        <a class="btn btn-xs btn-primary" href="{:U('Module/edit',array(id=>$vo['id']))}">编辑</a>

                        <if condition="$vo['issystem']">
                            <a class="btn btn-xs btn-default" disabled>删除</a>
                        <else />
                            <a class="btn btn-xs btn-primary" href="{:U('module/delete',array(id=>$vo['id']))}"  onclick="return confirm('您确定要卸载吗？')">删除</a>
                        </if>
                    </td>
                </tr>
                </volist>
            </tbody>
        </table>
    </form>

</div>
</block>